home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Techniques / XML Toolbox 0.6 / Reference < prev    next >
Text File  |  2000-04-07  |  4KB  |  94 lines

  1. XML Toolbox 0.6
  2.                                                           by Sascha René Leib
  3.  
  4. Reference:
  5.  
  6. Please use the sample project file to understand how the functions work.
  7. This document only provides a quick reference to the function names.
  8.  
  9. a) Parsing functions
  10.  
  11.  GetXMLTag (in as String, name as String)
  12.  GetXMLTag (in as String, name as String, byRef pos as Integer)
  13.  GetXMLTag (in as String, name as String, default as String)
  14.  
  15.   returns the first occurence of the tag "name" inside the "in" string.
  16.   - "pos" defines an optional start position (which will afterwards
  17.       point to the end of the tag)
  18.   - "default" will be returned if the tag could not be found. 
  19.  
  20.  GetXMLTagRegion (in as String, name as String)
  21.  GetXMLTagRegion (in as String, name as String, default as String)
  22.  GetXMLTagRegion (in as String, name as String, incl as Boolean)
  23.  GetXMLTagRegion (in as String, name as String, ByRef pos as Integer)
  24.  GetXMLTagRegion (in as String, name as String, ByRef pos as Integer, incl as Boolean)
  25.  
  26.   returns the contents of the tag region "name" in the "in" string.
  27.   - "pos" defines an optional start position (which will afterwards
  28.       point to the end of the tag)
  29.   - "default" will be returned if the tag could not be found. 
  30.   - if "incl" is true, the starting and closing tags will be included
  31.  
  32.  GetXMLTagParamStr (in as String, name as String, dflt as String)
  33.  
  34.   returns a named parameter from a tag. You need to extract the tag first
  35.   (using "GetXMLTag") and pass it as the "in" string!
  36.   - "dflt" will be returned if the parameter could not be found. 
  37.  
  38. b) Helpers
  39.  
  40.  XMLEncode (in as String)
  41.  
  42.   ISO-encodes the passed string. Note: This only works correctly with ISO-Latin1 (western) texts, though it should work sufficiently with other encodings.
  43.  
  44.  XMLDecode (in as String)
  45.  
  46.   decodes ISO-entities. Note: This only works correctly with ISO-Latin1 (western) encodings!
  47.  
  48.  XMLStr2Color (in as String, default as Color)
  49.  
  50.   converts a color string to a RB color object.
  51.  
  52. b) Internal
  53.  
  54.  GetXMLTagPos (in as String, name as String)
  55.  GetXMLTagPos (in as String, name as String, start as Integer)
  56.  
  57.   returns the position (as Integer) of the first occurence of the named tag
  58.   in the "in" string.
  59.   - "start" defines a start position for the search (default=0)
  60.  
  61.  GetXMLTagLen (in as String, start as Integer)
  62.  
  63.   returns the length of the tag starting at position "start" in the "in" string.
  64.  
  65. b) Generator
  66.  
  67.  MakeXMLTag (name as String)
  68.  MakeXMLTag (name as String, para1 as String, val1 as String [..])
  69.  
  70.   generates a tag with the passed name. Up to three parameters can be passed as name/value pairs.
  71.  
  72.  MakeXMLTagRegion (name as String, content as String)
  73.  MakeXMLTagRegion (name as String, content as String, para1 as String, val1 as String [..])
  74.  
  75.   generates a tag region (with closing tags) enclosing the "content" string. The parameters are the same as in the "MakeXMLTag" function 
  76.  
  77.  MakeXMLTagRegion (name as String, content as String)
  78.  MakeXMLTagRegion (name as String, content as String, para1 as String, val1 as String [..])
  79.  
  80.   generates an empty tag (with no content) similar to "MakeXMLTagRegion". The main difference is that you can choose to generate short empty tags as defined by XML 1.0 and XHTML 1.0 by changing the "kXMLUseShortEmptyTags" constant to "true" - although this is not recommended!
  81.  
  82.  MakeXMLEndTag (name as String)
  83.  
  84.   generates a simple ending tag with the passed name.
  85.  
  86. -----
  87.  
  88. Version history:
  89.  
  90. 0.6 first public beta
  91.             - added generator methods
  92.  
  93. 0.5 internal release
  94.             - started toolbox tester program